<template>
    <div style="width: 1000px;padding: 10px" >
        <div  v-html="chapter.content" >

        </div>
        <el-backtop >
            👆
        </el-backtop>
        <div style="width: 100%;text-align: center;margin: 40px 0">已经到底部啦~</div>
    </div>

</template>

<script>
    import request from "../utils/request";

    export default {
        name: "browseChapter",
        data(){
            return{
                chapter:{}
            }
        },
        created() {
            console.log(this.$route.params.id)
            this.getChapterById(this.$route.params.id)
        },
        methods:{
            getChapterById(id){
                request.get("/chapter/getChapterById/" + id).then(res => {
                    console.log(res)
                    this.chapter = res.data
                })

            }
        }
    }
</script>

<style scoped>

</style>